<%@ page language="java" pageEncoding="UTF-8"%><%request.setAttribute("ctx", request.getContextPath()); %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="/pub/frontHead.jsp" %>
</head>
<body>
	<div class="pop_mask"></div>
    <div class="pop_main">
    	<div class="bb_create">
        	<a href="javascript:window.close();" class="bb_create_close"></a>
        	<form id="babyForm"  method="post" enctype="multipart/form-data">
            <table cellpadding="0" cellspacing="0">
            	<tr>
                	<td width="82"><b class="font_14">宝宝生日:</b><em class="color_red">*</em></td>
                    <td><input type="text" class="bb_bri" name="babyBirthday" id="babyBirthday" readonly="readonly" value="<fmt:formatDate value="${user_info.babyBirthday }" pattern="yyyy-MM-dd"/>" onClick="WdatePicker()"/></td>
                </tr>
                <tr>
                	<td  width="82"><b class="font_14">宝宝性别:</b><em class="color_red">*</em></td>
                    <td>
                    	<input type="radio" name="babySex"  value='1' class="bb_gender" <c:if test="${user_info.babySex!='2'}">checked="checked"</c:if>/> 小王子
                    	<input type="radio" name="babySex"  value='2' class="bb_gender" <c:if test="${user_info.babySex=='2'}">checked="checked"</c:if>/> 小公主
                    </td>
                </tr>
                <tr>
                	<td  width="82"><b class="font_14">宝宝小名:</b><em class="color_red">*</em></td>
                    <td><input type="text" class="bb_name" name="babyName" id="babyName" value="${user_info.babyName }"/></td>
                </tr>
                <tr>
                	<td  width="82"><b class="font_14">宝宝头像:</b></td>
                    <td><input type="file" name="pic" id="pic"/><c:if test="${user_info.babyPic!=null}">&nbsp;&nbsp;&nbsp;<img src="${ctx}/frontSys!getPic.action?name=${user_info.babyPic}" width="40" height="40"/></c:if></td>
                </tr>
                <tr>
                	<td  width="82"><b class="font_14">宝宝身高:</b></td>
                    <td><input type="text" class="bb_tall" name="babyHeight" value="${user_info.babyHeight }" maxlength="3"/> 厘米</td>
                </tr>
                <tr>
                	<td  width="82"><b class="font_14">宝宝体重:</b></td>
                    <td><input type="text" class="bb_weight"  name="babyWeight" value="${user_info.babyWeight }" maxlength="3"/> 千克</td>
                </tr>
                <tr>
                    <td  width="82"></td>
                    <td><a href="javascript:doSubmit();" class="pop_bt">确&nbsp;定</a></td>
                </tr>
            </table>
            </form>
        </div>
    </div>
<script type="text/javascript">
<!--
//提交
function doSubmit(){	
	if ($("#babyBirthday").val()== ""){
		alert('宝宝生日不能为空！');
		return;
	}
	if ($("#babyName").val()== ""){
		alert('请给宝宝取个可爱的小名吧！');
		return;
	}	

	$.uploadEx({        
		url: '${ctx}/frontSys!updateBabyInfo.action', 
		formId: "babyForm",
		dataType: 'json',  
		onSend: function() {
	        return true;
	    },     
		onComplate: function(json) {        	
			if (json.code==0) {
				if(typeof window.opener.lanShow == "function"){
				window.opener.lanShow();
				}
				window.close();	
				
			}else{
				alert('宝宝信息记录失败！');
			}
		}
	});
}

//-->
</script>
</body>
</html>